#include <stdio.h>
#include <math.h>
#define E 0.5*1e-5
int main()
{
	double x0,x1,f1,f2;
	int num;
	num = 0;
	//x1 = 0.55;         //x1 = 0.55时没根
	x1 = 0.7;
	do{
		x0 = x1;
		f1 = pow(x0-1,2)*(2*x0-1);
		f2 = 6*pow(x0,2)-10*x0+4;
		x1 = x0 - 2*f1/f2;
		num++;
	}while(fabs(x1-x0)>=E);

	printf("The root is %lf.\n",x1);
	printf("The number of iterations is %d.\n",num);
	return 0;
}